#define _CRT_SECURE_NO_WARNINGS
#include"test.h"

class Solution {
public:
    int missingNumber(vector<int>& nums) {
        int ret = 0;
        for (auto e : nums)
        {
            ret ^= e;
        }
        for (int i = 0; i < nums.size() + 1; i++)
        {
            ret ^= i;
        }
        return ret;
    }
};